﻿@{
    ViewBag.Title = "jqGrid in ASP.NET MVC - Subgrid";

    var grid = new Lib.Web.Mvc.JQuery.JqGrid.JqGridHelper<jqGrid.Models.OrderViewModel>("orders",
        dataType: Lib.Web.Mvc.JQuery.JqGrid.JqGridDataTypes.Json,
        methodType: Lib.Web.Mvc.JQuery.JqGrid.JqGridMethodTypes.Post,
        pager: true,
        rowsNumber: 10,
        sortingName: "Id",
        sortingOrder: Lib.Web.Mvc.JQuery.JqGrid.JqGridSortingOrders.Asc,
        subgridEnabled: true,
        subgridModel: new Lib.Web.Mvc.JQuery.JqGrid.JqGridSubgridModel<jqGrid.Models.OrderDetailViewModel>(),
        subgridUrl: Url.Action("OrderDetailsSubgrid"),
        url: Url.Action("Orders"),
        viewRecords: true
    );
}

@grid.GetHtml()

@section JavaScript {
    <script type="text/javascript">
        $(document).ready(function () {
            @grid.GetJavaScript()
        });
    </script>
}